package com.code.modules.base.vo;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

public class ResourceVo implements Serializable {


    /**
     * 主键id
     */
    private Integer id;

    /**
     * 父id
     */
    private Integer pid;

    /**
     * 资源编号 例子：role:create,role:update,role:delete,role:view
     */
    private String code;
    /**
     * 父资源编号 0是顶级编号
     */
    private String pcode;
    /**
     * 当前资源的所有父资源编号
     */
    private String pcodes;
    /**
     * 资源名称
     */
    private String res_name;
    /**
     * 资源图标
     */
    private String icon;
    /**
     * url地址
     */
    private String url;
    /**
     * 资源排序号
     */
    private Integer num;
    /**
     * 资源层级
     */
    private Integer levels;
    /**
     * 类型 1:菜单menu 2:资源element(rest-api) 3:资源分类
     */
    private Integer res_type;
    /**
     * 访问方式 GET POST PUT DELETE PATCH
     */
    private String method;
    /**
     * 备注
     */
    private String tips;
    /**
     * 资源状态 :  1:启用   0:禁用
     */
    private Integer status;
    /**
     * 是否打开:    1:打开   0:不打开
     */
    private Integer isopen;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createtime;
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date updatetime;
    /**
     * 扩展字段
     */
    private String ext;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getPcode() {
        return pcode;
    }

    public void setPcode(String pcode) {
        this.pcode = pcode;
    }

    public String getPcodes() {
        return pcodes;
    }

    public void setPcodes(String pcodes) {
        this.pcodes = pcodes;
    }

    public String getRes_name() {
        return res_name;
    }

    public void setRes_name(String res_name) {
        this.res_name = res_name;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Integer getLevels() {
        return levels;
    }

    public void setLevels(Integer levels) {
        this.levels = levels;
    }

    public Integer getRes_type() {
        return res_type;
    }

    public void setRes_type(Integer res_type) {
        this.res_type = res_type;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getTips() {
        return tips;
    }

    public void setTips(String tips) {
        this.tips = tips;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getIsopen() {
        return isopen;
    }

    public void setIsopen(Integer isopen) {
        this.isopen = isopen;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }

    public String getExt() {
        return ext;
    }

    public void setExt(String ext) {
        this.ext = ext;
    }

    @Override
    public String toString() {
        return "ResourceVo{" +
                "id=" + id +
                ", pid=" + pid +
                ", code='" + code + '\'' +
                ", pcode='" + pcode + '\'' +
                ", pcodes='" + pcodes + '\'' +
                ", res_name='" + res_name + '\'' +
                ", icon='" + icon + '\'' +
                ", url='" + url + '\'' +
                ", num=" + num +
                ", levels=" + levels +
                ", res_type=" + res_type +
                ", method='" + method + '\'' +
                ", tips='" + tips + '\'' +
                ", status=" + status +
                ", isopen=" + isopen +
                ", createtime=" + createtime +
                ", updatetime=" + updatetime +
                ", ext='" + ext + '\'' +
                '}';
    }
}
